<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><link rel="stylesheet" href="http://localhost/HDPHP_CMS/Templates/default/css/style.css" />
<script type="text/javascript" src="http://localhost/HDPHP_CMS/Templates/default/js/js.js"></script>
</head>
<body>
	<!-- 顶部100%灰色区域 -->
	<div id="top_dark_box">
		<!-- 中间1200px宽度区域 -->
		<div id="top_dark">
			<a href="http://localhost/HDPHP_CMS"><img src="http://localhost/HDPHP_CMS/Templates/default/images/others/logo.jpg" id="logo" /></a>
			<!-- 导航菜单 -->
			<ul id="menu">
				<li>
					<a href="http://localhost/HDPHP_CMS" >首页</a>
				</li>
						<?php
		$data=K('Category')->where('is_show=1 and pid=3')->order('cid ASC')->limit(10)->findAll();
		?>
		<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
			$field['url']=U('List/index',array('cid'=>$field['cid']))
			?>
			
				<li>
					<a href="<?php echo $field['url'];?>" ><?php echo $field['cname'];?></a>
				</li>
				
		<?php }?><?php endif;?>
			</ul>
			<!-- 导航菜单结束 -->
			<!-- 用户登录 -->
			<div id="loginInfo" class='loginInfo'>
				<!-- <span>admin</span><a href="">退出</a>; -->
				<a href="javascript:void(0)" class="top_login">用户登录</a>
				<a href="javascript:showRegBox();">注册</a>
			</div>
			<!-- 用户登录对应隐藏区域 -->
			<form id="loginForm" action="" method="post">
			<div class="login_hide_box">
				<img src="http://localhost/HDPHP_CMS/Templates/default/images/sanjiao.gif" alt="" />
				<div class="middle">
					<p>用户名：</p>
					<input type="text" name="username" class="text" />
					<p>密码：</p>
					<input type="password" name="password" class="text" />
					<input type="submit" value="" class="sub" />
				</div>
				<div class="bottom">
					<a  href="javascript:showRegBox();" class="reg">注册</a>
				</div>
			</div>
			</form>
			
			<!-- 用户注册对应隐藏区域 -->
			<form id="regForm" action="" method="post">	
			<div class="reg_hide_box">
				<img src="http://localhost/HDPHP_CMS/Templates/default/images/sanjiao.gif" alt="" />
				<div class="middle">
					<p>用户名：</p>
					<input type="text" name="username_reg" class="text username" />
					<p>昵称：</p>
					<input type="text" name="nickname" class="text nickname" />
					<p>密码：</p>
					<input type="password" name="password_reg1" class="text password" />
					<p>确认密码：</p>
					<input type="password" name="password_reg2" class="text password" />
					<p>验证码：</p>
					<img src="" id="code" onclick="this.src=this.src + '&' + Math.random()"/>
					<input type="text"  name="code" class="text password_d" />
					<input type="submit" value="注册" class="sub" />
				</div>
			</div>
			</form>
		</div>
		<!-- 中间1200px宽度区域结束 -->
	</div>
	<!-- 顶部灰色100%区域结束 -->
	
	<!-- 顶部最新消息区域 -->
	<div id="latest_news_box">
		<div id="latest_news">
			<p><span class="title">最新消息：</span>大前端是一个关注web前端开发、用户体验设计、wordpress主题、前端招聘信息的站点</p>
		</div>
	</div>
	<!-- 顶部最新消息区域结束 -->
	<!-- 主体区域 -->
	<div id="main">
		<!-- 左侧区域 -->
		<div class="left">
				<div class='hd_title'>
					<strong>置顶推荐</strong>	
				</div>	
				<ul class='zhiding'>
					<?php			$data=K('ArticleView')->limit(2)->where('attr like "%置顶%" and cid=32')->order("sendtime DESC")->findAll();
			?>			<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
				$field['thumb']='http://localhost/HDPHP_CMS/'.$field['thumb'];
				$field['total']=K('Comment')->total_comment($field['aid']);
				$field['url']=U('Details/index',array('aid'=>$field['aid']));
			?>
			
						<li>
							<div class='image'>
								<a href="<?php echo $field['url'];?>">
									<img src="<?php echo $field['thumb'];?>" alt="<?php echo $field['title'];?>"/>
								</a>
							</div>
							<h2><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?></a></h2>
							<p><?php echo strip_tags($field['digest']);?></p>
						</li>
					
			<?php }?><?php endif;?>
				</ul>	
				<div class='hd_title'>
					<strong>最近文章</strong>	
				</div>	

			<ul class="arc_list">
			<?php			$data=K('ArticleView')->limit(4)->where('is_show=1 and is_recycle=0 and cid=32')->order("sendtime DESC")->findAll();
			?>			<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
				$field['thumb']='http://localhost/HDPHP_CMS/'.$field['thumb'];
				$field['total']=K('Comment')->total_comment($field['aid']);
				$field['url']=U('Details/index',array('aid'=>$field['aid']));
			?>
			
				<li>
					<div class="pic"><a href="<?php echo $field['url'];?>"><img width="150" height="100" src="<?php echo $field['thumb'];?>" alt="<?php echo $field['title'];?>" /></a></div>
					<h3><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?></a></h3>
					<span class="date"><?php echo date('m-d',$field['sendtime']);?></span>
					<a href="<?php echo $field['url'];?>" class="comment"><?php echo $field['total'];?>条评论</a>
					<span class="browse_number"><?php echo $field['click'];?>次浏览</span>
					<p class="description"><?php echo strip_tags($field['digest']);?></p>
				</li>
			
			<?php }?><?php endif;?>
			</ul>
		</div>
		<!-- 左侧区域结束 -->
		<!-- 右侧区域 -->
        <?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?><div class="right">
			<div class='hd_title'>
				<strong>标签云</strong>	
			</div>
			<div id="tagBox" class='tags'>
					<?php
		$data=K('Tag')->limit('10')->get_data();
		?>
		<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
		
				<a href=""><?php echo $field['tagname'];?></a>
			
		<?php }?><?php endif;?>
			</div>
			<div class='hd_title'>
				<strong>热门文章</strong>	
			</div>
			<ul class='arc_list'>
			<?php			$data=K('ArticleView')->limit(4)->where('attr like "%热门%" and cid=32')->order("sendtime DESC")->findAll();
			?>			<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
				$field['thumb']='http://localhost/HDPHP_CMS/'.$field['thumb'];
				$field['total']=K('Comment')->total_comment($field['aid']);
				$field['url']=U('Details/index',array('aid'=>$field['aid']));
			?>
			
				<li>
					<div class='image'>
						<a href="<?php echo $field['url'];?>">
							<img src="<?php echo $field['thumb'];?>" alt="<?php echo $field['title'];?>"/>
						</a>
					</div>
					<h2><a href="<?php echo $field['url'];?>"><?php echo $field['title'];?></a></h2>
					<p>
						<em><?php echo date('m-d',$field['sendtime']);?></em><span><?php echo $field['total'];?>条评论</span>
					</p>
				</li>
			
			<?php }?><?php endif;?>
			</ul>
			<div class='hd_title'>
				<strong>推荐文章</strong>	
			</div>
			
			<ul class='arc_list'>
			<?php			$data=K('ArticleView')->limit(2)->where('attr like "%推荐%" and cid=32')->order("sendtime DESC")->findAll();
			?>			<?php if(is_array($data)):?><?php  foreach($data as $field){ ?>
			<?php
				$field['thumb']='http://localhost/HDPHP_CMS/'.$field['thumb'];
				$field['total']=K('Comment')->total_comment($field['aid']);
				$field['url']=U('Details/index',array('aid'=>$field['aid']));
			?>
			
				<li>
					<div class='image'>
						<a href="<?php echo $field['url'];?>">
							<img src="<?php echo $field['thumb'];?>" alt="<?php echo $field['title'];?>"/>
						</a>
					</div>
					<h2><a href=""><?php echo $field['title'];?></a></h2>
					<p>
						<em><?php echo date('m-d',$field['sendtime']);?></em><span><?php echo $field['total'];?>条评论</span>
					</p>
				</li>
			
			<?php }?><?php endif;?>
			</ul>
		</div>
		<!-- 右侧区域结束 -->
	</div>
	<!-- 主体区域结束 -->
<?php if(!defined("HDPHP_PATH"))exit;C("SHOW_NOTICE",FALSE);?>	<!-- 底部浅灰色导航区域 -->
	<div id="bottom_menu_box" style="margin-top:30px;">
		<div class="bottom_menu">
			<dl>
				<dt><a href="">百度</a></dt>
			</dl>
			<dl>
				<dt><a href="">百度</a></dt>
			</dl>
		</div>
	</div>
	<!-- 底部浅灰色导航区域结束 -->

	<!-- 底部版权区域 -->
	<div id="bottom_copyright_box">
		<div class="bottom_copyright">
			版权信息
		</div>
	</div>
	<!-- 底部版权区域结束 -->
	
</body>
</html>
